﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Styx.Helpers;
using System.IO;
using Styx;
using Styx.Common;
using System.ComponentModel;
using DefaultValue = Styx.Helpers.DefaultValueAttribute;
using Styx.TreeSharp;

namespace DestroLock
{
    public class LockSettings : Settings
    {
        public static readonly LockSettings myPrefs = new LockSettings();

        public string SavePath = Path.Combine(Utilities.AssemblyDirectory, string.Format(@"Routines/Pasterke/Config/Warlock/{0}/DestroLockSettings-{1}.xml", StyxWoW.Me.RealmName, StyxWoW.Me.Name));

        public LockSettings()
            : base(Path.Combine(Utilities.AssemblyDirectory, string.Format(@"Routines/Pasterke/Config/Warlock/{0}/DestroLockSettings-{1}.xml", StyxWoW.Me.RealmName, StyxWoW.Me.Name)))
        {
        }
        //hotkeys
        public enum Keypress
        {
            None,
            LSHIFT,
            RSHIFT,
            LCTRL,
            RCTRL,
            LALT,
            RALT
        }

        [Setting]
        [DefaultValue(Keypress.None)]
        [Category(" Extra's ")]
        [DisplayName("Pause Key")]
        [Description("Set the key to pause the CR")]
        public Keypress PauseKeys { get; set; }

        [Setting]
        [DefaultValue(Keypress.None)]
        [Category(" Extra's ")]
        [DisplayName("Pause Aoe Key")]
        [Description("Set the key to pause Aoe")]
        public Keypress AoePauseKeys { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category(" Extra's ")]
        [DisplayName("Raid Style Messages")]
        [Description("Set to true if you want Raid Style messages if the CR or Aoe is paused")]
        public bool PrintMsg { get; set; }
        //movement
        [Setting]
        [DefaultValue(false)]
        [Category(" Movement ")]
        [DisplayName("Movement")]
        [Description("If you want auto movement or not")]
        public bool Movement { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category(" Movement ")]
        [DisplayName("Targeting")]
        [Description("If you want auto targeting or not")]
        public bool Targeting { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category(" Movement ")]
        [DisplayName("Facing")]
        [Description("If you want auto facing or not")]
        public bool Facing { get; set; }

        //pets
        public enum PetToCall
        {
            Imp,
            Voidwalker,
            Succubus,
            Felhunter
            /*FelImp,
            Voidlord,
            Observer,
            Shivarra*/

        }
        [Setting]
        [DefaultValue(PetToCall.Imp)]
        [Category(" Pet Stuff ")]
        [DisplayName("Demon to Summon")]
        [Description("Select this one as your Minion")]
        public PetToCall useDemon { get; set; }

        [Setting]
        [DefaultValue(55)]
        [Category(" Pet Stuff ")]
        [DisplayName("Health Funnel")]
        [Description("Use Health Funnel if my pet Health % <= Value.")]
        public int funnel { get; set; }

        [Setting]
        [DefaultValue(85)]
        [Category(" Pet Stuff ")]
        [DisplayName("Health Funnel out of combat")]
        [Description("Use Health Funnel if my pet Health % <= Value.")]
        public int funnelOOC { get; set; }

        //spells
        public enum SummonInfernal
        {
            Never,
            Five_and_More_Adds,
            Ten_and_More_Adds,
            Bosses_and_Adds,
            Bosses_Only
        }

        [Setting]
        [DefaultValue(CooldowPrefs.Manual)]
        [Category(" Spells ")]
        [DisplayName("Summon Doomguard")]
        [Description("When to Summon Doomguard")]
        public CooldowPrefs useSummonDoomGuard { get; set; }

        [Setting]
        [DefaultValue(SummonInfernal.Never)]
        [Category(" Spells ")]
        [DisplayName("Summon Infernal")]
        [Description("Summon Infernal when number of adds >= Value")]
        public SummonInfernal useSummonInfernal { get; set; }

        [Setting]
        [DefaultValue(75)]
        [Category(" Spells ")]
        [DisplayName("Arcane Torrent %")]
        [Description("Use Arcane Torrent if mana  <= Value")]
        public int useArcaneTorrent { get; set; }

        [Setting]
        [DefaultValue(25)]
        [Category(" Spells ")]
        [DisplayName("Unending Resolve %")]
        [Description("Use Unending Resolve when Health %  <= Value")]
        public int unendingResolve { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category(" Spells ")]
        [DisplayName("Unending Breath")]
        [Description("Auto cast if we are swimming or not")]
        public bool autoUnendingBreath { get; set; }

        [Setting]
        [DefaultValue(4)]
        [Category(" Spells ")]
        [DisplayName("Aoe")]
        [Description("4 is the recommended value for maximum dps with Fire and Brimstone")]
        public int startAoe { get; set; }

        [Setting]
        [DefaultValue(5)]
        [Category(" Spells ")]
        [DisplayName("Multi Dot")]
        [Description("Max targets to Multi Dot with Immolate")]
        public int maxDotTargets { get; set; }

        [Setting]
        [DefaultValue(CooldowPrefs.Manual)]
        [Category(" Spells ")]
        [DisplayName("Dark Soul")]
        [Description("When to use Dark Soul")]
        public CooldowPrefs darkSoul { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category(" Spells ")]
        [DisplayName("Twilight Ward")]
        [Description("Auto use in combat or not")]
        public bool useTwilightWard { get; set; }

        public enum CurseToUse
        {
            None,
            Corruption,
            Curse_of_Enfleebement,
            Curse_of_the_Elements

        }
        [Setting]
        [DefaultValue(CurseToUse.None)]
        [Category(" Spells ")]
        [DisplayName("Curse on target")]
        [Description("Kind of curse to use on target")]
        public CurseToUse useCurse { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category(" Spells ")]
        [DisplayName("Rain of Fire")]
        [Description("Use Rain of Fire (instant cast && not channeled) in normal rotation or not")]
        public bool useRainOfFire { get; set; }

        //cooldowns
        [Setting]
        [DefaultValue(4)]
        [Category(" Trinkets and Misc ")]
        [DisplayName("Elites-Rares")]
        [Description("If (Target.Max.Health - My.Max.Health) >= Value, use Cooldowns")]
        public int ElitesHealth { get; set; }

        //protection
        [Setting]
        [DefaultValue(55)]
        [Category(" Protection ")]
        [DisplayName("Drain Life")]
        [Description("Use Drain Life when my Health % <= Value")]
        public int useDrainLife { get; set; }

        [Setting]
        [DefaultValue(50)]
        [Category(" Protection ")]
        [DisplayName("Mortal Coil")]
        [Description("Use Mortal Coil when my Health % <= Value")]
        public int useMortalCoil { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category(" Protection ")]
        [DisplayName("Howl of Terror")]
        [Description("Use Howl of Terror if number of adds >= Value. Won't be used in raids of instances.")]
        public int useHowlOfTerror { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category(" Protection ")]
        [DisplayName("Healthstone")]
        [Description("Auto create Healthstone")]
        public bool createHealthStone{ get; set; }

        public enum SoulstonePrefs
        {
            Manual,
            onMySelf,
            onFocus
        }

        [Setting]
        [DefaultValue(SoulstonePrefs.Manual)]
        [Category(" Protection ")]
        [DisplayName("Soulstone")]
        [Description("Auto create Soulstone")]
        public SoulstonePrefs createSoulstone { get; set; }

        [Setting]
        [DefaultValue(55)]
        [Category(" Protection ")]
        [DisplayName("Healthstone %")]
        [Description("Use healthstone when my Health % <= Value")]
        public int healthstonepercent { get; set; }

        [Setting]
        [DefaultValue(25)]
        [Category(" Protection ")]
        [DisplayName("Ember Tap %")]
        [Description("Use Ember Tap when my Health % <= Value")]
        public int embertappercentpercent { get; set; }

        [Setting]
        [DefaultValue(45)]
        [Category(" Protection ")]
        [DisplayName("Dark Bargain %")]
        [Description("Use Dark Bargain when my Health % <= Value")]
        public int darkBargainpercent { get; set; }
        //rest

        [Setting]
        [DefaultValue(50)]
        [Category(" Rest ")]
        [DisplayName("Health %")]
        [Description("Eat Food when my Health % <= Value")]
        public int foodpercent { get; set; }

        [Setting]
        [DefaultValue(50)]
        [Category(" Rest ")]
        [DisplayName("Mana %")]
        [Description("Drink when my Mana % <= Value")]
        public int manapercent { get; set; }

        //pull
        public enum pullSpell
        {
            
            None,
            Shadow_Bolt,
            Corruption,
            Immolate,
            Curse_of_Enfeeblement,
            Curse_of_the_Elements
        }

        [Setting]
        [DefaultValue(pullSpell.None)]
        [Category(" Pulling ")]
        [DisplayName("Pull Spell")]
        [Description("Use that spell to pull. May change if you get new spells")]
        public pullSpell usePullSpell { get; set; }

        //Flasks & Potions

        public enum StatsPotion
        {
            None,
            Virmens_Bite, // 76089
            Potion_of_the_Mountains, // 76090
            Potion_of_Focus, // 76092
            Potion_of_the_Jade_Serpent, //76093
            Potion_of_Mogu_Power // 76095
        }
        [Setting]
        [DefaultValue(StatsPotion.None)]
        [Category("Flasks and Potions")]
        [DisplayName("Stats Potion")]
        [Description("Use that kind of Potion")]
        public StatsPotion useStatsPotion { get; set; }

        public enum WhenUseStatsPotion
        {
            Manual,
            RaidBosses,
            AllBosses
        }
        [Setting]
        [DefaultValue(WhenUseStatsPotion.Manual)]
        [Category("Flasks and Potions")]
        [DisplayName("Stats Potion Use")]
        [Description("When to use increase stats Potion")]
        public WhenUseStatsPotion whenToUseStatsPotion { get; set; }

        public enum FlaskToUse
        {
            Manual,
            Strenght, //76088
            Stamina, //76087
            Spirit, // 76086
            Intellect, // 76085
            Agility // 76084
        }

        public enum WhenToUseFlask
        {
            Manual,
            Raids,
            Raids_but_not_LFR,
            Instances
        }
        [Setting]
        [DefaultValue(FlaskToUse.Manual)]
        [Category("Flasks and Potions")]
        [DisplayName("Flask")]
        [Description("Flask to use when enter in combat")]
        public FlaskToUse kindOfFlaskToUse { get; set; }

        [Setting]
        [DefaultValue(WhenToUseFlask.Manual)]
        [Category("Flasks and Potions")]
        [DisplayName("Flask Use")]
        [Description("When to use Flasks when enter in combat")]
        public WhenToUseFlask whenToUseFlask { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Flasks and Potions")]
        [DisplayName("Alchemy Flask")]
        [Description("Use Alchemy Flask or not")]
        public bool useAlchemyFlask { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Flasks and Potions")]
        [DisplayName("Crystal of Insanity")]
        [Description("Use Crystal of Insanity or not")]
        public bool useCrystalOfInsanity { get; set; }

        //trinkets

        public enum CooldowPrefs
        {
            Manual,
            OnCoolDown,
            Bosses
        }
        [Setting]
        [DefaultValue(CooldowPrefs.Manual)]
        [Category(" Trinkets and Misc ")]
        [DisplayName("Trinket 1")]
        [Description("Use of trinkets")]
        public CooldowPrefs useTrinket1 { get; set; }

        [Setting]
        [DefaultValue(CooldowPrefs.Manual)]
        [Category(" Trinkets and Misc ")]
        [DisplayName("Trinket 2")]
        [Description("Use of trinkets")]
        public CooldowPrefs useTrinket2 { get; set; }

        [Setting]
        [DefaultValue(CooldowPrefs.Manual)]
        [Category(" Trinkets and Misc ")]
        [DisplayName("Engineer Gloves")]
        [Description("Use of Engineer Gloves")]
        public CooldowPrefs useEngiGloves { get; set; }

    }
}
